package com.itheima.controller;

import com.itheima.domain.ClassPeopleSum;
import com.itheima.domain.JobOption;
import com.itheima.domain.Result;
import com.itheima.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@Slf4j
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

//员工职位统计
    @GetMapping("/empJobData")
    public Result empJobData(){
        JobOption jobOption= reportService.empJobData();
        return Result.success(jobOption);
//性别统计
    }
    @GetMapping("/empGenderData")
    public Result empGenderData(){
        List<Map> empGenderData = reportService.empGenderData();
        return Result.success(empGenderData);
    }
    //学员学历统计
    @GetMapping("/studentDegreeData")
    public Result studentDegreeData(){
       List<Map>studentDegreeData= reportService.studentDegreeData();
       return Result.success(studentDegreeData);
    }

    //班级人数统计
    @GetMapping("/studentCountData")
    public Result studentCountData(){
      ClassPeopleSum classPeopleSum = reportService.studentCountData();
      return Result.success(classPeopleSum);

    }



}
